import {createRouter, createWebHistory} from "vue-router";

const Index =() => import(/* webpackChunkName: "about" */ '../views/Index.vue')
const HomeCenter =() => import(/* webpackChunkName: "about" */ '../views/pages/HomeCenter.vue')
const CourseCenter =() => import(/* webpackChunkName: "about" */ '../views/pages/CourseCenter.vue')
const CourseDetail =() => import(/* webpackChunkName: "about" */ '../views/course/CourseDetail.vue')
const ExamAnswerDetail =() => import(/* webpackChunkName: "about" */ '../views/pages/ExamCenter.vue')
const QuestionCenter =() => import(/* webpackChunkName: "about" */ '../views/pages/QuestionCenter.vue')
const QuestionList =() => import(/* webpackChunkName: "about" */ '../views/question/QuestionList.vue')
const QuestionDetail =() => import(/* webpackChunkName: "about" */ '../views/question/QuestionDetail.vue')
const QuestionEditor =() => import(/* webpackChunkName: "about" */ '../views/question/QuestionEditor.vue')
const NoticeCenter =() => import(/* webpackChunkName: "about" */ '../views/pages/NoticeCenter.vue')
const NoticeList =() => import(/* webpackChunkName: "about" */ '../views/notice/NoticeList.vue')
const NoticeDetail =() => import(/* webpackChunkName: "about" */ '../views/notice/NoticeDetail.vue')
const StudyCenter =() => import(/* webpackChunkName: "about" */ '../views/pages/StudyCenter.vue')
const PersonalDetail =() => import(/* webpackChunkName: "about" */ '../views/user/PersonalDetail.vue')
const PersonalCourse =() => import(/* webpackChunkName: "about" */ '../views/user/PersonalCourse.vue')
const PersonalExam =() => import(/* webpackChunkName: "about" */ '../views/user/PersonalExam.vue')
const PersonalQuestion =() => import(/* webpackChunkName: "about" */ '../views/user/PersonalQuestion.vue')
const PersonalHelpCenter =() => import(/* webpackChunkName: "about" */ '../views/user/PersonalHelpCenter.vue')

export const routes = [
    {
        path: '/',
        name: 'Index',
        component: Index,
        redirect: "/homeCenter",
        children: [
            {
                path: '/homeCenter',
                name: 'HomeCenter',
                component: HomeCenter
            },
            {
                path: '/courseCenter',
                name: 'CourseCenter',
                component: CourseCenter
            },
            {
                path: '/courseDetail',
                name: 'CourseDetail',
                component: CourseDetail
            },
            {
                path: '/questionCenter',
                name: 'QuestionCenter',
                component: QuestionCenter,
                redirect: "/questionList",
                children: [
                    {
                        path: '/questionList',
                        name: 'QuestionList',
                        component: QuestionList
                    },
                    {
                        path: '/questionDetail/:id',
                        name: 'QuestionDetail',
                        component: QuestionDetail
                    }
                ]
            },
            {
                path: '/questionEditor',
                name: 'QuestionEditor',
                component: QuestionEditor
            },
            {
                path: '/studyCenter',
                name: 'StudyCenter',
                component: StudyCenter,
                redirect: "/personalDetail",
                children: [
                    {
                        path: '/personalDetail',
                        name: 'PersonalDetail',
                        component: PersonalDetail
                    },
                    {
                        path: '/personalCourse',
                        name: 'PersonalCourse',
                        component: PersonalCourse
                    },
                    {
                        path: '/personalExam',
                        name: 'PersonalExam',
                        component: PersonalExam
                    },
                    {
                        path: '/personalQuestion',
                        name: 'PersonalQuestion',
                        component: PersonalQuestion
                    },
                    {
                        path: '/personalHelpCenter',
                        name: 'PersonalHelpCenter',
                        component: PersonalHelpCenter
                    }
                ]
            },
            {
                path: '/notice',
                name: 'NoticeCenter',
                component: NoticeCenter,
                redirect: "/notice/list",
                children: [
                    {
                        path: '/notice/list',
                        name: 'NoticeList',
                        component: NoticeList
                    },
                    {
                        path: '/notice/detail/:id',
                        name: 'NoticeDetail',
                        component: NoticeDetail
                    }
                ]
            }
        ]
    },
    {
        path: '/examAnswerDetail',
        name: 'ExamAnswerDetail',
        component: ExamAnswerDetail
    }
];

export const asyncRoutes = [
]

let routerOptions = {
    history: createWebHistory(process.env.BASE_URL),
    routes
};
let router = createRouter(routerOptions);
export default router;